﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using sgsBase;

namespace TestApp.Account
{
    public partial class Cregister : SgsPage
    {
        protected override void PageLoad(object sender, EventArgs e)
        {
			string id = CheckFormvar("id");

			if (id == "")
			{
				AddMessage("You must pass in a valid registration code that was supplied in an email.");
				return;
			}

			if (!Gl.CurUser.ValidateHashCode(id))
			{
				AddMessage("Invalid hash code provided, or you have already registered.");
				return;
			}

			//Gl.CurUser.NewUserSecurity(-1); //default user group is -1

			AddMessage("Registration Complete! You may now log in with your email address and password");
			Response.Redirect("login.aspx");

			//_continueUrl = Request.QueryString["ReturnUrl"];
        }
    }
}
